import { ref, reactive } from 'vue'
import { TASK_TYPE } from '@/utils/dictionary'
import { getAirList } from '@/api/task/index'

// 巡检机场
const ariList = ref([])

export const search = reactive({
  search: [
    {
      label: '任务名称',
      key: 'name',
      props: {
        placeholder: '请输入任务名称'
      }
    },
    {
      label: '任务时间',
      type: 'date',
      key: 'taskTime',
      props: {
        placeholder: '请选择巡检机场',
        type: 'datetimerange',
        format: 'yyyy-MM-dd HH:mm:ss'
      }
    }
  ]
})

// 巡检机场 列表
export const getAirInfo = async function() {
  const { data } = await getAirList()
  ariList.value = data?.records.map(it => ({
    ...it,
    label: it.name,
    value: it.id
  }))
}

